package com.github.phoenics.teacher.itheima.netty;

import com.sun.javaws.exceptions.OfflineLaunchException;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

/**
 * @author Phoenics Chow
 * on 2020年03月22日
 */
public class TestByteBuf {


    public static void main(String ...args){
        // 1.创建一个非池化的ByteBuf，大小为10个字节
        ByteBuf buf = Unpooled.buffer(10);
        //byte[] bytes = {1,2,3,4,5};
        //buf.writeBytes(bytes);
        buf.writeFloat(4.6f);
        float value=buf.readFloat();
        System.out.println(value);
        System.out.println("buf.writerIndex()="+buf.writerIndex());
    }

}
